package com.lyu.travel.core.service.impl;

import com.lyu.travel.core.entity.Place;
import com.lyu.travel.core.entity.Province;
import com.lyu.travel.core.entity.User;
import com.lyu.travel.core.mapper.PlaceMapper;
import com.lyu.travel.core.mapper.UserMapper;
import com.lyu.travel.core.service.PlaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: [travel]
 * @Package: [com.lyu.travel.core.service.impl]
 * @ClassName: [PlaceServiceImpl]
 * @Description: 景点业务实现类
 * @Author: [78483]
 * @CreateDate: [2020-06-14 10:11]
 * @UpdateUser: [78483]
 * @UpdateDate: [2020-06-14 10:11]
 * @UpdateRemark: [说明本次修改内容]
 * @Version: [v1.0]
 */
@Service
public class PlaceServiceImpl implements PlaceService {
    @Autowired
    private PlaceMapper placeMapper;

    @Override
    public List<Place> findAll() {
        return placeMapper.selectList(null);
    }

    @Override
    public List<Place> findPlaceByid(int id) {
        return placeMapper.findPlaceByid(id);
    }

    @Override
    public Place findPlaceByname(String name) {
        return placeMapper.findByPlacename(name);
    }

    @Override
    public int insert(Place place) {
        return placeMapper.insert(place);
    }

    @Override
    public int deletePlaceById(int id){
        return placeMapper.deleteById(id);
    }


    @Override
    public int updatePlace(Place place) {
        return placeMapper.updateById(place);
    }



}
